package com.hr.尚学堂.线性表;

/**
 * @author zhz
 * @date 2020/09/20
 **/
public class ArrayListDemo {
    public static void main(String[] args) {
        //1、创建对象
        ArrayList list=new ArrayList(3);
        //2、添加元素
        list.add("aa");
        list.add("bb");
        list.add("cc");
        list.add("cc");
        System.out.println(list.toString());
        System.out.println(list.size());
        //遍历list
        for (int i = 0; i < list.size(); i++) {
            System.out.println(list.get(i));
        }
    }
}
